<?php
/*................................................................
[七行 PHPCMS]
 .  VERSION: 1.0
 .  Author: SevenEl sevenelement@qq.com
 .  Support: http://www.sevenel.cn
................................................................*/
/*class configs
* */
class Sys {
	const VERSION = 1.0;
	//configure database
	private static $dbcfg = array(
									'sevenel'=>array(
											'host'=>"localhost",
											'user'=>"root",
											'psw'=>"",
											'database'=>"cms",
											'prefix'=>'se',
											'new_link'=>true,
											'encode'=>'utf8'
											),
									'sys'=>array(
											'host'=>"localhost",
											'user'=>"root",
											'psw'=>"",
											'database'=>"cms",
											'prefix'=>'lm',
											'new_link'=>true,
											'encode'=>'utf8'
											)
									);
	//configure The web arguments
	private static $site_config = array(
		'sitename' => '众盛科技'
	);
	private static $nowclass = array();
	static function Gv($name=''){
		if (!empty($name)){
		  return self::$site_config[$name];
		}else
		  return self::$site_config;
	}
	static function setc($classname,$handel){
			self::$nowclass[$classname][]=$handel;
		}

	static function getc(){
			return self::$nowclass;
		}

	static function Gp($name){
		switch (func_num_args()) {
			case 0:{
				return FALSE;
				break;
			}
			case 1:{
				if(is_array(func_get_arg(0))){
					$temp=func_get_arg(0);
					$now='';
					foreach ($temp as $value) {
						if(!$now){
							$now=self::${$value};
						}else{
							$now=$now[$value];
						}

					}
					return $now;
				}else {
					return self::${func_get_arg(0)};
				}

				break;
			}
			default:{
					return FALSE;
				break;
			}
		}
	}
}
?>
